Skip to content

initial setup and Hello World exercise#3

Merged
TheRealOwenRees merged 23 commits intoexercism:mainfrom
TheRealOwenRees:hello-world
Mar 8, 2026
Merged

initial setup and Hello World exercise#3
TheRealOwenRees merged 23 commits intoexercism:mainfrom
TheRealOwenRees:hello-world

Conversation

@TheRealOwenRees
Copy link
Contributor

Initial commit

  • boilerplate code and Rescript setup copied from the work of tesjasbubane mentioned on the forum post

  • Testing setup in accordance to previous completed work, using Rescript-Test

  • Hello World exercise added

  • npm run ci is the command from previous work which will compile ReScript files into JS and then test those. No doubt this command will need renaming.

Copy link
Member

@BNAndras BNAndras left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Made some notes. The main thing is to not set the track to active until we're ready to launch and have received feedback from other maintainers on the track / online editor

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is an old set of instructions. We don't need to do it right this moment, but before launch, let's make sure to have configlet sync docs and metadata for everything.

"indent_style": "space",
"indent_size": 4
"indent_size": 2,
"highlightjs_language": "reasonml"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How close is the ReasonML syntax for highlighting purposes? https://github.com/tsnobip/highlightjs-rescript might be a possibility. Exercism can load that NPM package or we can even spin up our own if we’re feeling particularly motivated.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

about 90% of the ReasonML syntax highlighting should work, but then it will fail on piping and parametric polymorphism. The package you linked looks good.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

skip utility function mimics test skipping, logging the test name to console (is that needed?). I added a skipped test here just to prove it works, and now CI is passing when unskipping.

No library change.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That might be confusing to students. I think it’s fine to forego skips with the current testing framework. Skipped tests are preferred if reasonably possible but not obligatory.

assertion(~message?, ~operator="stringEqual", (a, b) => a == b, a, b)`;

/**
* @param {string} testMethod - 'test' or 'skip'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My inclination is that the test generator should handle setting subsequent tests to be skipped at the end. The template here then is only concerned with setting up this specific case so it’s isolated and easier to reason about.

@@ -0,0 +1,15 @@
export const slug = 'hello-world';

export const assertionFunctions = `let stringEqual = (~message=?, a: string, b: string) =>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it make sense to build and document a small library of common assertion functions that can be pulled into templates? We can still have custom functions for more complicated assertions, but then we don’t need to reinvent things like checking if a returned value is true of not.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes I think this would be a good idea. I will scour through the rest of the exercises already implemented for this track in my repo and add those assertions for now, and add more as we move forward

export const template = (testMethod, c, moduleName) => {
return `${testMethod}("${c.description}", () => {
stringEqual(~message="${c.description}", ${moduleName}.hello(), "${c.expected}")
})\n\n`;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the generator should add the new lines here not the template. That means there would be less of a chance for things being formatted incorrectly.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That might be confusing to students. I think it’s fine to forego skips with the current testing framework. Skipped tests are preferred if reasonably possible but not obligatory.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bin is usually where that goes. I think we should create a template folder at the repo root that has these extra files in the relative spots where they are expected to go in the final exercise folder. Then you can copy the template folder to the exercise folder after configlet create does its thing.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh I thought this was in the hello world folder. We might as well give the students a .gitignore file in the exercise like the JS track does. At minimum, that means they won’t accidentally commit node_modules if they’re adding their solutions to a GitHub repo.

@TheRealOwenRees TheRealOwenRees merged commit 53d07b0 into exercism:main Mar 8, 2026
2 checks passed
@TheRealOwenRees TheRealOwenRees deleted the hello-world branch March 8, 2026 21:10
@BNAndras BNAndras mentioned this pull request Mar 9, 2026
24 tasks
@BNAndras BNAndras added x:size/large Large amount of work x:type/docs Work on Documentation x:module/practice-exercise Work on Practice Exercises labels Mar 9, 2026
@BNAndras BNAndras mentioned this pull request Mar 9, 2026
28 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

x:module/practice-exercise Work on Practice Exercises x:size/large Large amount of work x:type/docs Work on Documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants